﻿<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

<!-- source http://www.scnoob.com More templates http://www.scnoob.com/moban -->
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>等待商家确认收款</title>

    <link rel="stylesheet" type="text/css" th:href="@{/assets/css/bootstrap.min.css}">

    <link rel="stylesheet" type="text/css" th:href="@{/assets/fonts/line-icons.css}">

    <link th:href="@{/assets/plugins/datatables/dataTables.bootstrap4.min.css}" rel="stylesheet" type="text/css"/>
    <link th:href="@{/assets/plugins/datatables/buttons.bootstrap4.min.css}" rel="stylesheet" type="text/css"/>

    <link th:href="@{/assets/plugins/datatables/responsive.bootstrap4.min.css}" rel="stylesheet" type="text/css"/>

    <link rel="stylesheet" type="text/css" th:href="@{/assets/css/main.css}">

    <link rel="stylesheet" type="text/css" th:href="@{/assets/css/responsive.css}">
</head>
<body>
<div class="app header-default side-nav-dark">
    <div class="layout">

        <div class="page-container pl-0">
            <div class="main-content">
                <div class="container-fluid">
                    <div class="row">
                        <div class="col-12">
                            <div class="card">
                                <div class="card-header border-bottom">
                                    <h4 class="card-title">等待商家确认收款</h4>
                                    <div style="color: red" id="tips"></div>
                                </div>
                                <div type="text" style="display: none" id="userId"
                                     th:text="${session.userEntity.id}"></div>
                                <div class="card-body">
                                    <div class="table-responsive">

                                        <!--                                等待上级用户确认-->
                                        <div id="orderId" style="display: none;"
                                             th:text="${orderId}"></div>
                                        <div class="card" style="width: 100%;border-radius: 10px;padding-top: 20px">
                                            <div id="wait" style="width: 100%;text-align: center;font-size: 20px;color: #fe8e90">等待商家确认...</div>
                                        </div>

                                        <div style="width: 100%">
                                            <div id="img" class="card"
                                                 style="width: 50%;border-radius: 10px;margin: 10px 10px 0 10px">
                                                <img style="width: 50%;height: 50%"
                                                     src="http://img.zcool.cn/community/01e2b05be907a7a80121ab5d2ff816.gif">
                                            </div>
                                        </div>



                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                </div>


            </div>

        </div>
    </div>
</div>

<div id="preloader">
    <div class="loader" id="loader-1"></div>
</div>


<script th:src="@{/assets/js/jquery-min.js}"></script>
<script th:src="@{/assets/js/popper.min.js}"></script>
<script th:src="@{/assets/js/bootstrap.min.js}"></script>
<script th:src="@{/assets/js/jquery.app.js}"></script>
<script th:src="@{/assets/js/main.js}"></script>

<script th:src="@{/assets/plugins/datatables/jquery.dataTables.min.js}"></script>
<script th:src="@{/assets/plugins/datatables/dataTables.bootstrap4.min.js}"></script>

<script th:src="@{/assets/plugins/datatables/dataTables.buttons.min.js}"></script>
<script th:src="@{/assets/plugins/datatables/buttons.bootstrap4.min.js}"></script>
<script th:src="@{/assets/plugins/datatables/jszip.min.js}"></script>
<script th:src="@{/assets/plugins/datatables/pdfmake.min.js}"></script>
<script th:src="@{/assets/plugins/datatables/vfs_fonts.js}"></script>
<script th:src="@{/assets/plugins/datatables/buttons.html5.min.js}"></script>
<script th:src="@{/assets/plugins/datatables/buttons.print.min.js}"></script>
<script th:src="@{/assets/plugins/datatables/buttons.colVis.min.js}"></script>

<script th:src="@{/assets/plugins/datatables/dataTables.responsive.min.js}"></script>
<script th:src="@{/assets/plugins/datatables/responsive.bootstrap4.min.js}"></script>

<script th:src="@{/assets/js/datatables.init.js}"></script>
</body>
<script type="text/javascript">
    $("#datatable").DataTable({
        "oLanguage": {
            "sUrl": "/assets/page_zh_CN.json"
        }
    });


    $(function () {
        var orderId = $("#orderId").text();
        orderCommit(orderId);
    });

    // 订单提交
    function orderCommit(orderId) {
        $.post("findOrderEntityByOrderId",
            {
                "orderId": orderId
            },
            function (data) {
            console.log(data.referPayStatus,data.payStatus);
                if (data.referPayStatus != "1") {
                    $("#wait").attr("style","width: 100%;text-align: center;font-size: 20px;color: #b6bdba");
                    $("#wait").text("商家已确认付款");
                    $("#img").hide();
                } else {
                    var orderId1 = $("#orderId").text();
                    console.log("未确认支付", orderId1);
                    var t = window.setTimeout(function () {
                        clearTimeout(t);
                        orderCommit(orderId1);
                    }, 10000);
                }
            }
        )
    }
</script>


<script type="text/javascript">
    $(function () {
        $("#tips").hide();
    });

</script>


<!-- source http://www.scnoob.com More templates http://www.scnoob.com/moban -->
</html>


